package com.gupaoedu.springboot.springbootfirst.firstDemo;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Author: JLL
 * @Date: 2019/7/4 14:36
 */
@ComponentScan(basePackages = "com.gupaoedu.springboot.springbootfirst.firstDemo")
public class ConfigurationMain {

    public static void main(String[] args) {
//        ClassPathXmlApplicationContext
        /*AnnotationConfigApplicationContext annotationConfigApplicationContext =
                new AnnotationConfigApplicationContext(ConfigurationDemo.class);
        DemoClass demoClass =
                annotationConfigApplicationContext.getBean("demoClass",DemoClass.class);
        demoClass.testMethod();*/

        AnnotationConfigApplicationContext applicationContext =
                new AnnotationConfigApplicationContext(ConfigurationMain.class);
//        System.out.println(applicationContext.getDisplayName());
        String[] defNames=applicationContext.getBeanDefinitionNames();
        for (String defName : defNames) {
            System.out.println(defName);
        }

    }

}
